// DumpBuffer.cpp: implementation of the DumpBuffer class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include "DumpBuffer.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////


DumpBuffer :: DumpBuffer()
{
	Clear() ; 
}


void DumpBuffer :: Clear()
{
	current = buffer ;
}


void DumpBuffer :: Printf( const char* format, ... )
{
	// protect against obvious buffer overflow
	if( current - buffer < BUFFER_SIZE )
    {
		va_list argPtr ;
		va_start( argPtr, format ) ;
		int count = vsprintf( current, format, argPtr ) ;
		va_end( argPtr ) ;
		current += count ;
    }
}


